//
//  ShopMainPageRightTableViewCell.m
//  BaseFrame
//
//  Created by ENERGY on 2018/5/11.
//  Copyright © 2018年 com.mxh. All rights reserved.
//

#import "ShopMainPageCellRightTableViewCell.h"

@interface ShopMainPageCellRightTableViewCell()
@property (nonatomic, strong)UIButton * produceBtn;//商品图片
@property (nonatomic, strong)UILabel * produceTitleLab;//商品名称
@property (nonatomic, strong)UILabel * producePriceLab;//商品价格
@end

@implementation ShopMainPageCellRightTableViewCell

- (id)initWithCellIdentifier:(NSString *)cellID{
//    self = [super initWithFrame:frame];
    self = [super initWithCellIdentifier:cellID];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.contentView addSubview:self.produceBtn];
        [self.contentView addSubview:self.producePriceLab];
        [self.contentView addSubview:self.produceTitleLab];
        
        __weak typeof (self)weak = self;
        [self.produceBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(5/WIDTH_5S_SCALE);
            make.top.mas_equalTo(8/WIDTH_5S_SCALE);
            make.width.mas_equalTo(88/WIDTH_5S_SCALE);
            make.bottom.mas_equalTo(-3/WIDTH_5S_SCALE);
        }];
        [self.produceTitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(weak.produceBtn.mas_right).offset(10/WIDTH_5S_SCALE);
            make.top.equalTo(weak.produceBtn);
            make.height.equalTo(weak.produceBtn.mas_height).multipliedBy(0.5);
            make.right.equalTo(weak.mas_right).offset(-5/WIDTH_5S_SCALE);
        }];
        [self.producePriceLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(weak.produceTitleLab.mas_bottom);
            make.left.right.height.equalTo(weak.produceTitleLab);
        }];
    }return self;
}

- (UIButton *)produceBtn{
    if (!_produceBtn) {
        _produceBtn = [[UIButton alloc] init];
        _produceBtn.titleLabel.font = DEF_FontSize_14;
        [_produceBtn setBackgroundColor:[UIColor orangeColor]];
    }
    return _produceBtn;
}

- (UILabel *)produceTitleLab{
    if (!_produceTitleLab) {
        _produceTitleLab = [[UILabel alloc] init];
        _produceTitleLab.font = DEF_FontSize_14;
        _produceTitleLab.textColor = [UIColor blackColor];
        _produceTitleLab.textAlignment = NSTextAlignmentLeft;
        _produceTitleLab.text = @"商品名称";
    }return _produceTitleLab;
}

- (UILabel *)producePriceLab{
    if (!_producePriceLab) {
        _producePriceLab = [[UILabel alloc] init];
        _producePriceLab.font = DEF_FontSize_14;
        _producePriceLab.textColor = [UIColor blackColor];
        _producePriceLab.textAlignment = NSTextAlignmentLeft;
        _producePriceLab.text = @"商品价格";
    }return _producePriceLab;
}
@end
